Skip to content

Conversation

@boorad
Copy link
Collaborator

@boorad boorad commented Nov 29, 2025

Summary

Ported subtle.encrypt() and subtle.decrypt() from 0.x branch to work with OpenSSL 3.3+ and Nitro Modules, bringing encrypt/decrypt functionality to feature parity with 0.x.

Implementation

C++ Cipher Implementations

  • Created GCMCipher with proper IV length handling via EVP_CTRL_GCM_SET_IVLEN for non-standard IVs (matching Node.js behavior)
  • Created HybridRsaCipher Nitro module for RSA-OAEP encrypt/decrypt operations
  • Updated HybridCipherFactory to route GCM mode to specialized cipher

TypeScript/Nitro Bindings

  • Implemented aesCipher() for AES-CTR, AES-CBC, AES-GCM modes
  • Implemented rsaCipher() for RSA-OAEP operations
  • Created rsaCipher.nitro.ts spec with encrypt/decrypt methods
  • Wired up subtle.encrypt() and subtle.decrypt() to call appropriate cipher functions
  • Fixed dynamic import issue in aesGenerateKey() (Metro bundler compatibility)

Test Fixes

  • Updated error message expectations for OpenSSL 3.3+
  • Fixed test bugs (plaintext comparison, private key import)

Result

All 191 subtle.encrypt/decrypt tests passing ✅ (AES-CTR, AES-CBC, AES-GCM, RSA-OAEP)

@boorad boorad self-assigned this Nov 29, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2025

🤖 End-to-End Test Results - Android

Status: ✅ Passed
Platform: Android
Run: 19779218976

📸 Final Test Screenshot

Maestro Test Results - android

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2025

🤖 End-to-End Test Results - iOS

Status: ✅ Passed
Platform: iOS
Run: 19779218992

📸 Final Test Screenshot

Maestro Test Results - ios

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@boorad boorad merged commit 88d6b09 into main Nov 29, 2025
7 checks passed
@boorad boorad deleted the feat/subtle-encrypt-decrypt branch November 29, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants